//
// Created by Jinyu Zhu on 2022/4/20.
//

#ifndef PROVDB_TAG_GRAPH_ALGORITHM_GRAPH_H
#define PROVDB_TAG_GRAPH_ALGORITHM_GRAPH_H

#include "graph.h"
#include <vector>
#include<iostream>
#include <queue>

class AlgorithmUndirectedGraph {
public:
//    static void LoadOneTsv(const PDirectedGraph& PG, const std::string& TsvPath);

    static void Track(const PUndirectedGraph& PG) {}
    //AlgorithmUndirectedGraph(const PUndirectedGraph& PG) :PG(PG) {}

    //find neighbor from Node id
    //return node id vector
    static std::vector<int> Find_neighbor(const PUndirectedGraph& PG,int id);

    //evaluate
    // id               nodes' id
    // degree_weight    Weighting of degrees
    // value_weight     Weighting of values(Weighting of degrees)
    static double Evaluate(const PUndirectedGraph& PG, int id,double degree_weight = 0.5,double value_weight=0.5/*double other_weight*/);


    //find top k in neighbor
    // return id vector
    static std::vector<int> Find_Topk_neighbor(const PUndirectedGraph& PG, int id,int k, double degree_weight = 0.5, double value_weight = 0.5/*double other_weight*/);

    //find Recommended path
    //return node id in path
    static std::vector<int> Find_recommend_path(const PUndirectedGraph& PG, int id, double degree_weight = 0.5, double value_weight = 0.5/*double other_weight*/);

    

//private:
//    const PUndirectedGraph PG;
    static void Find_recommend_path_helper(const PUndirectedGraph& PG, int id, std::vector<int>& recommend_path_id, int maxpathsize, double degree_weight = 0.5, double value_weight = 0.5/*double other_weight*/);
};


#endif //PROVDB_TAG_GRAPH_ALGORITHM_GRAPH_H
